
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Grebok.Common;
using Grebok.Common.Configuration;

namespace JieBooLaw.Persistence.Test.DataManager
{
    public class TSys_RoleManager : BaseManager
    {
        #region private field

        private static TSys_RoleManager manager;
        #endregion

        #region Properties
        
        public Int32? RoleID
        {
            get { return GetConfig<Int32?>("RoleID"); }
            set { SetConfig<Int32?>("RoleID", value); }
        }
        
        public Int32? PRoleID
        {
            get { return GetConfig<Int32?>("PRoleID"); }
            set { SetConfig<Int32?>("PRoleID", value); }
        }
        
        public Int32? Level
        {
            get { return GetConfig<Int32?>("Level"); }
            set { SetConfig<Int32?>("Level", value); }
        }
        
        public String RoleCode
        {
            get { return GetConfig<String>("RoleCode"); }
            set { SetConfig<String>("RoleCode", value); }
        }
        
        public String RoleName
        {
            get { return GetConfig<String>("RoleName"); }
            set { SetConfig<String>("RoleName", value); }
        }
        
        public String Description
        {
            get { return GetConfig<String>("Description"); }
            set { SetConfig<String>("Description", value); }
        }
        
        public Boolean? Active
        {
            get { return GetConfig<Boolean?>("Active"); }
            set { SetConfig<Boolean?>("Active", value); }
        }
        

        #endregion

        #region Constructor

        /// <summary>
        /// TSys_RoleManager
        /// </summary>
        private TSys_RoleManager()
        {
            IApplicationConfiguration configuration = ApplicationConfigurationFactor.CreateApplicationConfiguration();
            appPropertiese = new ApplicationProperties(configuration[PropertiesConst.TSYS_ROLE_PROPERTIES_FILE_NAME_KEY],
                configuration[PropertiesConst.TSYS_ROLE_PROPERTIES_SECTION_NAME_KEY]);

            appPropertieseValues = new Dictionary<string, object>();
        }
        #endregion

        #region TSys_RoleManager Instance

        /// <summary>
        /// TSys_RoleManager's Instance
        /// </summary>
        public static TSys_RoleManager Instance
        {
            get
            {
                if (manager == null)
                {
                    manager = new TSys_RoleManager();
                }
                return manager;
            }
        }
        #endregion

    }
}
